package com.td.core.obj.utils;

import java.util.Calendar;

@Deprecated
public class TDTimer {

	long startTime;
	long maxTime;
	boolean end;
	
	public TDTimer(long time) {
		
		restart(time);
	}
	
	public boolean update() {
		
		if(!end && Calendar.getInstance().getTimeInMillis() - startTime >= maxTime) {
			end = true;
			return true;
		}
		return false;
		
	}
	
	public void restart(long time) {
		maxTime = time;
		restart();
	}
	
	public void restart() {
		startTime = Calendar.getInstance().getTimeInMillis();
		end = false;
	}
}
